package be.bonamis.umpire.domain;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@IdClass(PersonDogId.class)
public class PersonDog {
 
    @Id
    @ManyToOne
    @JoinColumn(name="person_id", nullable = false)
    private Person person;
 
    @Id
    @ManyToOne
    @JoinColumn(name="dog_id", nullable = false)
    private Dog dog;
 
    @Temporal(TemporalType.DATE)
    private Date adoptionDate;

	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	public Dog getDog() {
		return dog;
	}

	public void setDog(Dog dog) {
		this.dog = dog;
	}

	public Date getAdoptionDate() {
		return adoptionDate;
	}

	public void setAdoptionDate(Date adoptionDate) {
		this.adoptionDate = adoptionDate;
	}
 
}